<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="com.is.control.*" %>
<%@ page import="com.is.model.*" %>
<%@ page import="com.is.util.*" %>
<%@page import="com.is.model.Student"%>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="../../resources/css/default.css" rel="stylesheet" type="text/css" />
<link href="../../resources/css/common.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../resources/js/jquery-1.8.1.js"></script>
<script type="text/javascript" src="../../resources/js/jquery.artDialog.js"></script>
<title>Insert title here</title>
</head>
<body>
<%
	request.setCharacterEncoding("UTF-8");
	Student s = new Student();
	s.setPassportName(ParamUtil.getString(request,"passportName","未填写"));
	s.setChineseName(ParamUtil.getString(request,"chineseName","未填写"));
	//System.out.println("sssss" + request.getParameter("passportName"));
	s.setPicPath(ParamUtil.getString(request,"picPath","/InterStu/resources/image/man.GIF"));
	s.setNationality(ParamUtil.getString(request,"nationality","未填写"));
	s.setNationalityEn(ParamUtil.getString(request,"nationalityEn","未填写"));
	s.setSex(ParamUtil.getString(request,"sex","空"));
	s.setBirthday(ParamUtil.getString(request,"birthday","未填写"));
	s.setClassId(ParamUtil.getString(request,"classId","空"));
	s.setPassportNumber(ParamUtil.getString(request,"passportNumber","未填写"));
	s.setCscNumber(ParamUtil.getString(request,"CSCNumber","未填写"));
	s.setScholarshipType(ParamUtil.getString(request,"scholarshipType","未填写"));
	s.setLevel(ParamUtil.getString(request,"level","未填写"));
	s.setDuration(ParamUtil.getString(request,"duration","2012-11-01至2012-11-21"));
	s.setUniversity(ParamUtil.getString(request,"university","未填写"));
	s.setMajor(ParamUtil.getString(request,"major","未填写"));
	s.setVisaApplicationPath(ParamUtil.getString(request,"Application","未填写"));
	s.setAdmissionPath(ParamUtil.getString(request,"Admission","未填写"));
	s.setPassportPath(ParamUtil.getString(request,"Passport","未填写"));
	s.setChineseVisaPath(ParamUtil.getString(request,"ChineseVisa","未填写"));
	s.setType(ParamUtil.getString(request,"type","未填写"));
	s.setTip(ParamUtil.getString(request,"tip","未填写"));
	session.setAttribute("stu",s);
	if(StudentControl.insertStudent(s)){
	//System.out.println(s.getId());
%>
	<script type='text/javascript'>
     $.dialog({
     	icon:"succeed",
     	content:"系统已将您录入的学生信息记录",
     	ok:function(){
     		window.location.href="student_add.jsp";
     	}
     	
     })
		//alert("录入信息成功");
		
	</script>
<%

	} else{
%>
	<script type='text/javascript'>
	$.dialog({
     	icon:"error",
     	content:"录入信息失败，请检查您的输入是否有误再重试",
     	ok:function(){
     		 window.location.href="student_add.jsp";
     	}
     	
     })
	</script>
<%
	}
%>
</body>
</html>